{namespace codepage}

/**
 * This is a Closure Template.
 *
 * To regenerate just en.js, run this command:
 * java -jar ../_soy/SoyToJsSrcCompiler.jar --outputPathFormat generated/en.js --srcs ../template.soy,template.soy
 *
 * To regenerate all files, see: trunk/apps/template.soy.
 */

/**
 * Web page structure.
 */
{template .start}
  <div id="MSG" style="display: none">
    // Common messages.  So is Apps.blocklyMessage, which appears later.
    <span id="httpRequestError">{msg meaning="Apps.httpRequestError" desc="IBID"}There was a problem with the request.{/msg}</span>
    <span id="linkAlert">{msg meaning="Apps.linkAlert" desc="IBID"}Share your blocks with this link:\n\n%1{/msg}</span>
    <span id="hashError">{msg meaning="Apps.hashError" desc="IBID"}Sorry, '%1' doesn't correspond with any saved program.{/msg}</span>
    <span id="xmlError">{msg meaning="Apps.xmlError" desc="IBID"}Could not load your saved file.  Perhaps it was created with a different version of Blockly?{/msg}</span>

    <span id="badXml">{msg meaning="Code.badXml" desc="alert - Message shown when the user tries switching from the XML tab after entering XML text that could not be parsed.  This asks whether they wish to abandon the XML they added.  If they select 'OK' (or the translated equivalent), the XML is cleared, and the other tab is shown.  If they select 'Cancel', they remain on the XML tab with the bad XML."}Error parsing XML:\n%1\n\nAbandon changes?{/msg}</span>
    <span id="badCode">{msg meaning="Code.badCode" desc="alert - Message shown if an error occurs while interpreting the user program.  The error description follows."}Program error:\n%1{/msg}</span>
    <span id="timeout">{msg meaning="Code.timeout" desc="alert - Message shown if the program has run for more than the permitted number of steps.  This exists so that programs with infinite loops do not run forever."}Maximum execution iterations exceeded.{/msg}</span>
    <span id="discard">{msg meaning="Code.discard" desc="alert - Message shown after the user clicks on the 'discard all' icon.  Selecting 'OK' (or the translated equivalent) causes all of the blocks to be discarded.  Selecting 'Cancel' prevents blocks from being deleted."}Delete all %1 blocks?{/msg}</span>
  </div>

  <table width="100%" height="100%">
    <tr>
      <td>
        <h1>
          <span id="title">
            <a href="../index.html">{msg meaning="Apps.blocklyMessage" desc="IBID"}Blockly{/msg}</a>
            {sp}:{sp}
            {msg meaning="Code.title" desc="title - Title of this application, indicating that it is for writing arbitrary programs."}
              Code
            {/msg}
          </span>
        </h1>
      </td>
      <td class="farSide">
        <select id="languageMenu" onchange="BlocklyApps.changeLanguage();"></select>
      </td>
    </tr>
    <tr>
      <td colspan=2>
        <table>
          <tr id="tabRow" height="1em">
            <td id="tab_blocks" class="tabon" onclick="tabClick(this.id)">{msg meaning="Code.blocks" desc="tab text - Displays and allows editing of the user's program as blocks."}Blocks{/msg}</td>
            <td class="tabmin">&nbsp;</td>
            <td id="tab_javascript" class="taboff" onclick="tabClick(this.id)">JavaScript</td>
            <td class="tabmin">&nbsp;</td>
            <td id="tab_python" class="taboff" onclick="tabClick(this.id)">Python</td>
            <td class="tabmin">&nbsp;</td>
            <td id="tab_xml" class="taboff" onclick="tabClick(this.id)">XML</td>
            <td class="tabmax">
              <button title="{msg meaning="Code.trashTooltip" desc="tooltip - Clicking on this causes the user program to be discarded."}Discard all blocks.{/msg}" onclick="discard(); renderContent();">
                <img src='../../media/1x1.gif' class="trash icon21">
              </button>{sp}
              <button id="linkButton" title="{msg meaning="Apps.linkTooltip" desc="IBID."}Save and link to blocks.{/msg}" onclick="BlocklyStorage.link()">
                <img src='../../media/1x1.gif' class="link icon21">
              </button>{sp}
              <button title="{msg meaning="Apps.runTooltip" desc="IBID"}Run the program defined by the blocks in the workspace.{/msg}" class="launch" onclick="runJS()">
                <img src='../../media/1x1.gif' class="run icon21">
              </button>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="99%" colspan=2>
        {call .toolbox /}
        <iframe id="content_blocks" src="frame.html?{$ij.langSrc}"></iframe>
        <pre id="content_javascript"></pre>
        <pre id="content_python"></pre>
        <div id="content_xml">
          <textarea id="textarea_xml"></textarea>
        </div>
      </td>
    </tr>
  </table>
{/template}

/**
 * Toolbox.
 */
{template .toolbox}
  <xml id="toolbox" style="display: none">
    <category name="{msg meaning="Apps.catLogic" desc="IBID"}Logic{/msg}">
      <block type="controls_if"></block>
      <block type="logic_compare"></block>
      <block type="logic_operation"></block>
      <block type="logic_negate"></block>
      <block type="logic_boolean"></block>
      <block type="logic_null"></block>
      <block type="logic_ternary"></block>
    </category>
    <category name="{msg meaning="Apps.catLoops" desc="IBID"}Loops{/msg}">
      <block type="controls_repeat_ext">
        <value name="TIMES">
          <block type="math_number">
            <title name="NUM">10</title>
          </block>
        </value>
      </block>
      <block type="controls_whileUntil"></block>
      <block type="controls_for">
        <value name="FROM">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
        <value name="TO">
          <block type="math_number">
            <title name="NUM">10</title>
          </block>
        </value>
        <value name="BY">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
      </block>
      <block type="controls_forEach"></block>
      <block type="controls_flow_statements"></block>
    </category>
    <category name="{msg meaning="Apps.catMath" desc="IBID"}Math{/msg}">
      <block type="math_number"></block>
      <block type="math_arithmetic"></block>
      <block type="math_single"></block>
      <block type="math_trig"></block>
      <block type="math_constant"></block>
      <block type="math_number_property"></block>
      <block type="math_change">
        <value name="DELTA">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
      </block>
      <block type="math_round"></block>
      <block type="math_on_list"></block>
      <block type="math_modulo"></block>
      <block type="math_constrain">
        <value name="LOW">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
        <value name="HIGH">
          <block type="math_number">
            <title name="NUM">100</title>
          </block>
        </value>
      </block>
      <block type="math_random_int">
        <value name="FROM">
          <block type="math_number">
            <title name="NUM">1</title>
          </block>
        </value>
        <value name="TO">
          <block type="math_number">
            <title name="NUM">100</title>
          </block>
        </value>
      </block>
      <block type="math_random_float"></block>
    </category>
    <category name="{msg meaning="Apps.catText" desc="IBID"}Text{/msg}">
      <block type="text"></block>
      <block type="text_join"></block>
      <block type="text_append">
        <value name="TEXT">
          <block type="text"></block>
        </value>
      </block>
      <block type="text_length"></block>
      <block type="text_isEmpty"></block>
      <block type="text_indexOf">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.textVariable" desc="IBID"}text{/msg}</title>
          </block>
        </value>
      </block>
      <block type="text_charAt">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.textVariable" desc="IBID"}text{/msg}</title>
          </block>
        </value>
      </block>
      <block type="text_getSubstring">
        <value name="STRING">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.textVariable" desc="IBID"}text{/msg}</title>
          </block>
        </value>
      </block>
      <block type="text_changeCase"></block>
      <block type="text_trim"></block>
      <block type="text_print"></block>
      <block type="text_prompt"></block>
    </category>
    <category name="{msg meaning="Apps.catLists" desc="IBID"}Lists{/msg}">
	<block type="lists_input_n"></block>
	<block type="lists_create_empty"></block>
      <block type="lists_create_with"></block>
      <block type="lists_repeat">
        <value name="NUM">
          <block type="math_number">
            <title name="NUM">5</title>
          </block>
        </value>
      </block>
      <block type="lists_length"></block>
      <block type="lists_isEmpty"></block>
      <block type="lists_indexOf">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</title>
          </block>
        </value>
      </block>
      <block type="lists_getIndex">
        <value name="VALUE">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</title>
          </block>
        </value>
      </block>
      <block type="lists_setIndex">
        <value name="LIST">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</title>
          </block>
        </value>
      </block>
      <block type="lists_getSublist">
        <value name="LIST">
          <block type="variables_get">
            <title name="VAR">{msg meaning="Apps.listVariable" desc="IBID"}list{/msg}</title>
          </block>
        </value>
      </block>
    </category>
    <category name="{msg meaning="Apps.catColour" desc="IBID"}Colour{/msg}">
      <block type="colour_picker"></block>
      <block type="colour_random"></block>
      <block type="colour_rgb"></block>
      <block type="colour_blend"></block>
    </category>
    <category name="{msg meaning="Apps.catVariables" desc="IBID"}Variables{/msg}" custom="VARIABLE"></category>
    <category name="{msg meaning="Apps.catProcedures" desc="IBID"}Procedures{/msg}" custom="PROCEDURE"></category>
  </xml>
{/template}
